$interpolate ( service in module ng )

Description

Compiles a string with markup into an interpolation function. This service is used by the HTML $compile service for data binding. See $interpolateProvider for configuring the interpolation markup.

  var $interpolate = ...; // injected
  var exp = $interpolate('Hello {{name}}!');
  expect(exp({name:'Angular'}).toEqual('Hello Angular!');

Dependencies

Usage

$interpolate(text[, mustHaveExpression]);

Parameters

Returns

{function(context)}

an interpolation function which is used to compute the interpolated string. The function has these parameters:

  • context : an object against which any expressions embedded in the strings are evaluated against.

Methods